package com.fare.taluo.core.domain.analyse.report;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import com.fare.taluo.fetl.domain.base.*;
import com.dayatang.domain.InstanceFactory;
@Entity
@Table(name="CSAIR_REPORT")
@SuppressWarnings("serial")
public class CsairReportEntity extends BaseFetlEntity{

	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO, generator = FDC_SEQ_GEN)
	@SequenceGenerator(name = FDC_SEQ_GEN, sequenceName = FDC_SEQUENCE)
	
	private Long id;
	
	//报表日期
	@Column(name="REPROT_DATE")
	private Date deprotDate;
	
	//航班日期
	@Column(name="FLIGHT_DATE")
	private Date flightDate;
	
	//航班类型 0单程，1往返
	@Column(name="FLIGHT_TYPE")
	private int flightType;
	
	//出发城市三字码
	@Column(name="FROM_CITY")
	private String fromCity;
	
	//出发城市名称
	@Column(name="FROM_CITY_NAME")
	private String fromCityName;
	
	//到达城市三字码
	@Column(name ="TO_CITY")
	private String toCity;
	
	//到达城市名称
	@Column(name ="TO_CITY_NAME")
	private String toCityName;
	
	//航班号，单程 CZ1234 往返 CZ1234-CZ4321
	@Column(name ="FLIGHT_NO")
	private String flightNo;
	
	//B2C价格
	@Column(name ="PRICE")
	private Double price;
	
	//淘宝价格
	@Column(name ="TAOBAO_PRICE")
	private Double taobaoPric;
	
	//淘宝代理商名称
	@Column(name ="TAOBAO_AGENT_NAME")
	private String taobaoAgentName;
	
	// 淘宝代理商地址
	@Column(name ="TAOBAO_AGENT_ADDRESS")
	private String tabaoAgentAddess;
	
	//淘宝与官网价差金额  官网-淘宝
	@Column(name ="TAOBAO_SPREAD_AMOUNT")
	private Double taobaoSpreadAmount;
	
	//淘宝价差  （官网-淘宝）/官网*100%，小数点后保留2位 1.13%  0.0113；
	@Column(name ="TAOBAO_SPREAD")
	private Double taobaoSpread;
	
	//去哪儿价格
	@Column(name ="QUNAR_PRICE")
	private Double qunaerPrice;
	
	//去哪儿代理商名称
	@Column(name ="QUNAR_AGENT_NAME")
	private String qunaerAgentName;
	
	//去哪儿代理商地址
	@Column(name ="QUNAR_AGENT_ADDRESS")
	private String qunaerAgentAdderss;	
	
	//去哪儿与官网价差金额 官网-去哪儿
	@Column(name ="QUNAR_SPREAD_AMOUNT")
	private Double qunaerSpreadAmount;
	
	//去哪儿价差 （官网-去哪儿）/官网*100%，小数点后保留2位 1.13%；
	@Column(name ="QUNAR_SPREAD")
	private Double qunaerSpread;
	
	//生成&修改时间
	@Column(name ="GRAB_TIME")
	private Date grabTime;
	//国内&&国际    1国内航线   2国际航线
	@Column(name ="WEB_TYPE")
	private int type;
	
	@Column(name="HBASE_KEY")
	private String hbaseKey;
	
	@Column(name="CHANNEL")
	private String channel;
	
	@Column(name="GRAB_HBASE_KEY")
	private String grabHbaseKey;
	
	@Column(name="GRAB_CHANNEL")
	private String grabChannel;
	
	
	
	public Long getId() {
		return id;
	}


	public Date getDeprotDate() {
		return deprotDate;
	}

	public void setDeprotDate(Date deprotDate) {
		this.deprotDate = deprotDate;
	}

	public Date getFlightDate() {
		return flightDate;
	}

	public void setFlightDate(Date flightDate) {
		this.flightDate = flightDate;
	}

	public int getFlightType() {
		return flightType;
	}

	public void setFlightType(int flightType) {
		this.flightType = flightType;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public String getFlightNo() {
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Double getTaobaoPric() {
		return taobaoPric;
	}

	public void setTaobaoPric(Double taobaoPric) {
		this.taobaoPric = taobaoPric;
	}

	public String getTaobaoAgentName() {
		return taobaoAgentName;
	}

	public void setTaobaoAgentName(String taobaoAgentName) {
		this.taobaoAgentName = taobaoAgentName;
	}

	public String getTabaoAgentAddess() {
		return tabaoAgentAddess;
	}

	public void setTabaoAgentAddess(String tabaoAgentAddess) {
		this.tabaoAgentAddess = tabaoAgentAddess;
	}

	public Double getTaobaoSpreadAmount() {
		return taobaoSpreadAmount;
	}

	public void setTaobaoSpreadAmount(Double taobaoSpreadAmount) {
		this.taobaoSpreadAmount = taobaoSpreadAmount;
	}

	public Double getTaobaoSpread() {
		return taobaoSpread;
	}

	public void setTaobaoSpread(Double taobaoSpread) {
		this.taobaoSpread = taobaoSpread;
	}

	public Double getQunaerPrice() {
		return qunaerPrice;
	}

	public void setQunaerPrice(Double qunaerPrice) {
		this.qunaerPrice = qunaerPrice;
	}

	public String getQunaerAgentName() {
		return qunaerAgentName;
	}

	public void setQunaerAgentName(String qunaerAgentName) {
		this.qunaerAgentName = qunaerAgentName;
	}

	public String getQunaerAgentAdderss() {
		return qunaerAgentAdderss;
	}

	public void setQunaerAgentAdderss(String qunaerAgentAdderss) {
		this.qunaerAgentAdderss = qunaerAgentAdderss;
	}

	public Double getQunaerSpreadAmount() {
		return qunaerSpreadAmount;
	}

	public void setQunaerSpreadAmount(Double qunaerSpreadAmount) {
		this.qunaerSpreadAmount = qunaerSpreadAmount;
	}

	public Double getQunaerSpread() {
		return qunaerSpread;
	}

	public void setQunaerSpread(Double qunaerSpread) {
		this.qunaerSpread = qunaerSpread;
	}

	public void setId(Long id) {
		this.id = id;
	}

	private static CsairReportEntityRepository CsairReportEntityRepository;
	
	public static List<CsairReportEntity> findCsairEntityAll(String dateStr) {
		return getCsairReportEntityRepository().findCsairEntityAll(dateStr);
	}
	public List<CsairReportEntity> findCsairEntityByCondition(String hbaseKey,String fromCityCode,String toCityCode,String startDate,String endDate,String flightDate,String grabDate,  String grabHbaseKey,String type){
		return getCsairReportEntityRepository().findCsairEntityByCondition(hbaseKey,fromCityCode,toCityCode,startDate,endDate,flightDate,  grabDate, grabHbaseKey, type); 
	}
	public static CsairReportEntityRepository getCsairReportEntityRepository(){
		if(CsairReportEntityRepository ==null){
			CsairReportEntityRepository=InstanceFactory.getInstance(CsairReportEntityRepository.class);
		}
		return CsairReportEntityRepository;
	}


	@Override
	public boolean isNew() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean existed() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean notExisted() {
		// TODO Auto-generated method stub
		return false;
	}


	@Override
	public boolean existed(String propertyName, Object propertyValue) {
		// TODO Auto-generated method stub
		return false;
	}


	public Date getGrabTime() {
		return grabTime;
	}


	public void setGrabTime(Date grabTime) {
		this.grabTime = grabTime;
	}


	public int getType() {
		return type;
	}


	public void setType(int type) {
		this.type = type;
	}

	


	public String getHbaseKey() {
		return hbaseKey;
	}


	public void setHbaseKey(String hbaseKey) {
		this.hbaseKey = hbaseKey;
	}


	public String getChannel() {
		return channel;
	}


	public void setChannel(String channel) {
		this.channel = channel;
	}


	public String getGrabHbaseKey() {
		return grabHbaseKey;
	}


	public void setGrabHbaseKey(String grabHbaseKey) {
		this.grabHbaseKey = grabHbaseKey;
	}


	public String getGrabChannel() {
		return grabChannel;
	}


	public void setGrabChannel(String grabChannel) {
		this.grabChannel = grabChannel;
	}
	
	
	
	
	
}
